import request from '@/utils/request'

export function getViewTreeData() {
  return request({
    url: '/api/v1/views/treeData',
    method: 'get'
  })
}

export function addView(data) {
  return request({
    url: '/api/v1/views',
    method: 'post',
    data
  })
}

export function updateView(id, data) {
  return request({
    url: `/api/v1/views/${id}`,
    method: 'put',
    data
  })
}

export function deleteView(id) {
  return request({
    url: `/api/v1/views/${id}`,
    method: 'delete'
  })
}
